home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / Macintosh Programmer’s Workshop / MPW 3.1 / MPW / Interfaces / CIncludes / Palettes.h < prev    next >
Text File  |  1990-12-13  |  4KB  |  118 lines

  1. /************************************************************
  2.  
  3. Created: Saturday, September 16, 1989 at 4:25 PM
  4.     Palettes.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.     Copyright Apple Computer, Inc.    1987-1989
  9.     All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __PALETTES__
  15. #define __PALETTES__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21. #ifndef __WINDOWS__
  22. #include <Windows.h>
  23. #endif
  24.  
  25. #define pmCourteous 0            /*Record use of color on each device touched.*/
  26. #define pmTolerant 2            /*render ciRGB if ciTolerance is exceeded by best match.*/
  27. #define pmAnimated 4            /*reserve an index on each device touched and render ciRGB.*/
  28. #define pmExplicit 8            /*no reserve, no render, no record; stuff index into port.*/
  29. #define pmInhibitG2 256
  30. #define pmInhibitC2 512
  31. #define pmInhibitG4 1024
  32. #define pmInhibitC4 2048
  33. #define pmInhibitG8 4096
  34. #define pmInhibitC8 8192
  35.  
  36. /* NSetPalette Update Constants */
  37.  
  38. #define pmNoUpdates 0x8000        /*no updates*/
  39. #define pmBkUpdates 0xA000        /*background updates only*/
  40. #define pmFgUpdates 0xC000        /*foreground updates only*/
  41. #define pmAllUpdates 0xE000     /*all updates*/
  42.  
  43. struct ColorInfo {
  44.     RGBColor ciRGB;             /*true RGB values*/
  45.     short ciUsage;                /*color usage*/
  46.     short ciTolerance;            /*tolerance value*/
  47.     short ciDataFields[3];        /*private fields*/
  48. };
  49.  
  50. typedef struct ColorInfo ColorInfo;
  51. struct Palette {
  52.     short pmEntries;            /*entries in pmTable*/
  53.     short pmDataFields[7];        /*private fields*/
  54.     ColorInfo pmInfo[1];
  55. };
  56.  
  57. typedef struct Palette Palette;
  58. typedef Palette *PalettePtr, **PaletteHandle;
  59.  
  60. #ifdef __cplusplus
  61. extern "C" {
  62. #endif
  63. pascal void InitPalettes(void)
  64.     = 0xAA90;
  65. pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
  66.     short srcTolerance)
  67.     = 0xAA91;
  68. pascal PaletteHandle GetNewPalette(short PaletteID)
  69.     = 0xAA92;
  70. pascal void DisposePalette(PaletteHandle srcPalette)
  71.     = 0xAA93;
  72. pascal void ActivatePalette(WindowPtr srcWindow)
  73.     = 0xAA94;
  74. pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
  75.     = 0xAA95;
  76. pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
  77.     = 0xAA95;
  78. pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  79.     = 0xAA96;
  80. pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
  81.     short srcEntry,short dstEntry,short dstLength)
  82.     = 0xAAA1;
  83. pascal void PmForeColor(short dstEntry)
  84.     = 0xAA97;
  85. pascal void PmBackColor(short dstEntry)
  86.     = 0xAA98;
  87. pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor *srcRGB)
  88.     = 0xAA99;
  89. pascal void AnimatePalette(WindowPtr dstWindow,CTabHandle srcCTab,short srcIndex,
  90.     short dstEntry,short dstLength)
  91.     = 0xAA9A;
  92. pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor *dstRGB)
  93.     = 0xAA9B;
  94. pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor *srcRGB)
  95.     = 0xAA9C;
  96. pascal void GetEntryUsage(PaletteHandle srcPalette,short srcEntry,short *dstUsage,
  97.     short *dstTolerance)
  98.     = 0xAA9D;
  99. pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
  100.     short srcTolerance)
  101.     = 0xAA9E;
  102. pascal void CTab2Palette(CTabHandle srcCTab,PaletteHandle dstPalette,short srcUsage,
  103.     short srcTolerance)
  104.     = 0xAA9F;
  105. pascal void Palette2CTab(PaletteHandle srcPalette,CTabHandle dstCTab)
  106.     = 0xAAA0;
  107. pascal long Entry2Index(short srcEntry)
  108.     = {0x7000,0xAAA2};
  109. pascal void RestoreDeviceClut(GDHandle gdh)
  110.     = {0x7002,0xAAA2};
  111. pascal void ResizePalette(PaletteHandle srcPalette,short dstSize)
  112.     = {0x7003,0xAAA2};
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116.  
  117. #endif
  118.